package com.dao;

import java.util.ArrayList;

import org.apache.log4j.Logger;
import org.hibernate.Query;
import org.hibernate.Session;

import com.metier.Ecole;
import com.metier.IEcole;
import com.metier.SessionManager;


public class EcoleDAO extends BaseEcoleDAO implements com.dao.IEcoleDAO {

	/**
	 * Loggeur
	 */
	private static final Logger LOG4J = Logger.getLogger(UtilisateurBasiqueDAO.class);
	
	public EcoleDAO () {}
	
	public EcoleDAO (Session session) {
		super(session);
	}

	public static ArrayList<IEcole> listerEcoles() {
		LOG4J.debug("Entre dans : listerEcoles");
		Session session = SessionManager.currentSession();
		
		Query q = session.createQuery("from Ecole");
		ArrayList<IEcole> ecoles = (ArrayList<IEcole>)q.list();
		
		SessionManager.closeSession();
		LOG4J.debug("Sort de : listerEcoles");
		return ecoles;
	}
}